package com.kaluli.project.repository.impl;

import java.sql.Timestamp;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.http.client.utils.DateUtils;
import org.springframework.stereotype.Repository;

import com.kaluli.project.domain.entity.KllMq;
import com.kaluli.project.domain.entity.KllMqBak;
import com.kaluli.project.domain.entity.KllOptlog;
import com.kaluli.project.domain.repository.KllMqRepository;
import com.kaluli.project.domain.repository.KllOptlogRepository;
import com.kaluli.project.utils.DateOprator;
import com.kaluli.system.repository.AbstractRepositorySupport;

@Repository
public class KllOptlogRepositoryImpl extends AbstractRepositorySupport<KllOptlog>
		implements KllOptlogRepository{

	

	public List<KllOptlog> findMoveList() {
		Date time = DateOprator.getPrevMonthByLength(new Date(), 1);
		StringBuffer hql=new StringBuffer(" from KllOptlog t where FROM_UNIXTIME(opt_time)<'"+DateUtils.formatDate(time, "yyyy-MM-dd HH:MM:ss")+"'");
		Map<String,Object> params=new HashMap<String, Object>();
		return this.findHqlForMap(hql.toString(), params);
	}


	@Override
	protected Class<KllOptlog> getEntityClass() {
		// TODO 自动生成的方法存根
		return KllOptlog.class;
	}
	
	

}
